package com.wksc.authority.controller;

import com.wksc.authority.service.SysAuthorityGroupService;
import com.wksc.framework.message.BaseMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 权限组controller
 * @author Zero
 */
@Controller
@RequestMapping("/authorityGroup")
public class SysAuthorityGroupController {
    private static final Logger L = LoggerFactory.getLogger(SysAuthorityGroupController.class);

    @Autowired
    private SysAuthorityGroupService authorityGroupService;

    @RequestMapping(value = "save", method = RequestMethod.POST)
    @ResponseBody
    public BaseMessage saveGroup() {
        try {
            return authorityGroupService.saveAuthorityGroup(null);
        } catch (Exception ex) {
            L.error("保存权限组信息失败！", ex);
            return BaseMessage.errorMsg("保存权限组信息失败！");
        }
    }

}
